package com.zt.service;

import io.minio.errors.*;

import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

public interface FileStorageService {

    //上传  html  png  jpg  mp3  mp4

    /**
     * 上传html文件到minio里面
     *
     * @param fileName
     * @param inputStream
     * @return 地址
     */
    public String uploadHtmlFile(String fileName, InputStream inputStream) throws IOException, ServerException, InvalidBucketNameException, InsufficientDataException, ErrorResponseException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException, ServerException, InvalidBucketNameException, InsufficientDataException, ErrorResponseException, InvalidResponseException;

    //下载
    //删除
    String uploadImageFile(String fileName, InputStream inputStream) throws IOException, ServerException, InvalidBucketNameException, InsufficientDataException, ErrorResponseException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    /**
     * 上传图片字节数组到MinIO
     * @param fileName 文件名
     * @param imageBytes 图片字节数组
     * @return 文件访问URL
     */
    String uploadImageBytes(String fileName, byte[] imageBytes) throws IOException, ServerException, InvalidBucketNameException, InsufficientDataException, ErrorResponseException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;
}
